/**
* @ProjectName: ShopSytem
* @Title: OrderList.java 
* @Package com.element5th.shop.servlet.order 
* @Description: 显示用户的订单列表
* @author 第五元素小组   
* @date 2012-10-26 16:55:38 
* @version V1.0   
*/
package com.element5th.shop.servlet.order;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.element5th.comm.DateUtil;
import com.element5th.shop.comm.BaseDao;
import com.element5th.shop.comm.DaoFactory;
import com.element5th.shop.dao.order.IOrderDao;
import com.element5th.shop.dto.BaseDto;

/**
 * Servlet implementation class OrderList
 */
@WebServlet("/page/user/orderlist")
public class OrderList extends HttpServlet {
	private static final long serialVersionUID = 1L;
       

	/**
	 * @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void service(HttpServletRequest request, HttpServletResponse response) 
			throws ServletException, IOException {
		BaseDto orderListDto = new BaseDto();
		//得到订单实例
		orderListDto.getOrderList();
		IOrderDao dao = DaoFactory.getOrderDao();
		//定义一个List，用来装订单
		List<BaseDto> list = new ArrayList<BaseDto>();
		//查到所有的订单,可以得到user实体表，支付方式
		list = dao.orderList();
		
		request.setAttribute("orderlist", list);
		
		this.getServletContext().getRequestDispatcher("/page/user/orderlist.jsp").forward(request, response);

	}

}
